
public class OpExp extends Exp {
    public Exp left, right;
    public int oper;
    final public static int Plus=1, Minus=2, Times=3, Div=4;
    public OpExp(Exp l, int o, Exp r) {
        left=l; oper=o; right=r;
    }
    public int interpret(Table t){
        int v1 = left.interpret(t);
        int v2 = right.interpret(t);
        switch(oper){
            default:
            case Plus:
                return v1+v2;
            case Minus:
                return v1-v2;
            case Times:
                return v1*v2;
            case Div:
                return v1/v2;
        }
    }
}
